#ifndef GAME_MAP_H
#define GAME_MAP_H

#include <Gosu/Gosu.hpp>
#include <Gosu/Utility.hpp>
#include <Gosu/AutoLink.hpp> // Makes life easier for Windows users compiling this.

#include "boost/multi_array.hpp"

#include <cstdlib>
#include <vector>
#include <fstream>
#include "Position.h"
#include "objects.h"


class GameMap
{


public:

	GameMap(Gosu::Graphics& gfx, std::vector<bigTile> *bigTiles, std::vector<smallTile> *smallTiles);

	bool onMap(const PosDouble &b);
	void draw();
	void loadMap(const char * mapName);
	PosDouble scroll(const PosDouble &b);
	boost::multi_array<Cell, 2> *getAIMap(int blocksize, int &w, int &h);



private:

	void saveGrid(const char * fileName, boost::multi_array<Cell, 2> *grid, int blocksize);

	double setSmallDiff(int x, int y);

	boost::multi_array<int, 2> bigGrid;
	boost::multi_array<int, 2> smallGrid;


	int width,height, displacementX, displacementY,	windowHeight,windowWidth;


	Gosu::Graphics * graphics;


	std::vector<bigTile> bigTiles;
	std::vector<smallTile> smallTiles;
	std::vector<Gosu::Image *> bigImages;
	std::vector<Gosu::Image *> smallImages;




};

#endif